/*
 *******************************************************************************
 *                                EIT Car Project
 *                             Main FUNCTIONS
 *
 *                     (c) Copyright 2015-2020 Car@EIT 
 *                            All Rights Reserved
 * File      : main.c
 * This file is part of EIT Car Project
 * Embedded Innovation Team(EIT) - Car@EIT  
 * ----------------------------------------------------------------------------
 * LICENSING TERMS:
 * 
 *     CarLib is provided in source form for FREE evaluation and  educational 
 * use.
 *    If you plan on using  CarLib  in a commercial product you need to contact 
 * Car@EIT to properly license its use in your product. 
 * 
 * ----------------------------------------------------------------------------
 * Change Logs:
 * Date           Author       Notes
 * 2015-01-22     Zhu Jian Ning    the first version
 *
 *******************************************************************************
 */

#include   "EIT_Steer.h"


void Steer_Init(void)
{
   ftm_pwm_init(FTM1, FTM_CH0 ,STEER_PWM_FREQ , STEER_PWM_MID);
}
void Steer_Turn(int32 pwm)
{
  int32 pwm_turn;
   if(pwm<STEER_PWM_MIN)
     pwm_turn=STEER_PWM_MIN;
   if(pwm>STEER_PWM_MAX)
     pwm_turn=STEER_PWM_MAX;
   else
     pwm_turn=pwm;
   ftm_pwm_duty(FTM1, FTM_CH0, pwm_turn);
}